﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Student
    {
        public int num { get; set; }
        public string name { get; set; }
        public int age { get; set; }

        public Student(int num, string name, int age)
        {
            this.num = num;
            this.name = name;
            this.age = age;
        }
        public override string ToString()
        {
            return $"学号{num}，姓名{name}，年龄{age}";
        }
    }

    class NumSort : Comparer<Student>
    {
       

        public override int Compare(Student x, Student y)
        {
            return y.num.CompareTo(x.num);
        }
    }
    class namesort : Comparer<Student>
    {
        public override int Compare(Student x, Student y)
        {
            return y.name.CompareTo(x.name);
        }


    }
    class agesort : Comparer<Student>
    {
        public override int Compare(Student x, Student y)
        {
            return y.age.CompareTo(x.age);
        }


    }
}
